home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act6b / 00032_Field_32.txt < prev    next >
Text File  |  1995-03-28  |  2KB  |  67 lines

  1. on keydown
  2.   global WhichBug, TxtCursor
  3.   set tensdigit to 21 + ((WhichBug -1) * 2) --GJI ADDED
  4.   set onesdigit to 22 + ((WhichBug -1) * 2) --GJI added
  5.   
  6.   if (the key = return) or (the key = enter) then
  7.     if (char 2 of field "changer") = "" then -- get rid of cursor in ones digit
  8.       set the visible of sprite onesdigit to false
  9.       set the castnum of sprite onesdigit to the number of cast "tens"
  10.       set TxtCursor to 0 -- no cursor
  11.     end if
  12.     
  13.     checkit
  14.     
  15.   else
  16.     if the key = BACKSPACE then 
  17.       set monkey = field "changer"
  18.       if the number of chars in monkey > 1 then 
  19.         set monkey = char 1 to (the number of chars in monkey -1) of monkey
  20.         set the text of cast "changer" = monkey
  21.       else 
  22.         set the text of cast "changer" = ""
  23.       end if
  24.     else
  25.       if the number of chars in field "changer" < 2 then --GJI Changed 3 to 2
  26.         if (the key >="0") and (the key <= "9") then  put (field "changer"  & the key) into field "changer"
  27.       end if    
  28.     end if
  29.     
  30.     set holdchar1 to (char 1 of field "changer")
  31.     set holdchar2 to (char 2 of field "changer")
  32.     
  33.     if holdchar1 = "" then
  34.       set the visible of sprite onesdigit to false
  35.       set the castnum of sprite tensdigit to the number of cast "tens"
  36.       set TxtCursor to tensdigit
  37.       updatestage
  38.       set the visible of sprite tensdigit to true
  39.       
  40.     else --there must be a digit in the tens place so show it
  41.       
  42.       set the castnum of sprite tensdigit = ├é
  43.            the number of cast ("digit" & holdchar1)
  44.       updatestage
  45.       set the visible of sprite tensdigit to true
  46.       
  47.       if holdchar2 = "" then
  48.         set the castnum of sprite onesdigit to the number of cast "tens"
  49.         updatestage
  50.         set Txtcursor to onesdigit
  51.         set the visible of sprite onesdigit to true
  52.         
  53.       else
  54.         
  55.         set the castnum of sprite onesdigit = ├é
  56.            the number of cast ("digit" & holdchar2)
  57.         set TxtCursor to 0 -- no cursor
  58.         updatestage
  59.         set the visible of sprite onesdigit to true
  60.         
  61.       end if
  62.     end if
  63.     -- stuff above added
  64.   end if
  65.   
  66. end 
  67.